package com.sjtu.rental.services;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sjtu.rental.entity.SysVariable;

@Service
public class VariableService {

	@Autowired
	private GenericDao genericDao;

	public static int DISTRICT = 1;

	@SuppressWarnings("unchecked")
	public List<SysVariable> getVarsList(Integer type) {
		DetachedCriteria c = DetachedCriteria.forClass(SysVariable.class);
		c.add(Restrictions.eq("type", type));
		return genericDao.getHibernateTemplate().findByCriteria(c);
	}

}
